<template>
  <div>
    <el-dialog
      width="45%"
      title="工单配置"
      :visible="$store.state.dialog.typeDialog"
      :before-close="handleClose"
    >
      <el-form ref="form" :model="form" label-width="300px">
        <el-form-item label="补货警戒线：">
            <el-input-number
              v-model="num"
              controls-position="right"
              @change="handleChange"
              :min="1"
              :max="1000"
            ></el-input-number>
        </el-form-item>
        <el-form-item>
          <el-button type="primary">取消</el-button>
          <el-button @click="onSubmit">确认</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import {getBhX,editBhX} from '@/api/oder'
export default {
  name: 'typeDialog',
  props: {},
  data() {
    return {
      num: 10,
      form:{}
    }
  },
  components: {},
  methods: {
    handleClose() {
      this.$store.commit('dialog/updatetypeDialog', false)
    },
    async onSubmit(){
      const res = await editBhX(this.num)
      console.log(res);
      this.$store.commit('dialog/updatetypeDialog', false)
    },
    handleChange(){},
    async getBhX(){
      this.num = await getBhX()
    }
  },
  computed: {},
  mounted() {
    this.getBhX()
  },
  watch: {},
}
</script>

<style scoped lang="scss">
</style>
